package todo;
import done.*;
import se.lth.cs.realtime.semaphore.CountingSem;
import se.lth.cs.realtime.semaphore.Semaphore;

public class AlarmClock  {

	private static ClockInput	input;
	private static ClockOutput	output;
	private static Semaphore	sem; 
	private SharedData sharedData;

	public AlarmClock(ClockInput i, ClockOutput o) {
		input = i;
		output = o;
		sem = input.getSemaphoreInstance();
		sharedData = new SharedData(output, input);
		TimeHandler timeHandler = new TimeHandler(output, sharedData);
		timeHandler.start();
		ButtonHandler buttonHandler = new ButtonHandler(input, sharedData);
		buttonHandler.start();
	}

	// The AlarmClock thread is started by the simulator. No
	// need to start it by yourself, if you do you will get
	// an IllegalThreadStateException. The implementation
	// below is a simple alarmclock thread that beeps upon 
	// each keypress. To be modified in the lab.
	public void start() {
		
	}
}
